home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2005 March / Macworld CD March 2005 - Marathon Trilogy.iso / Shareware World / Text Processing / HexEdit Release.sit / HexEdit Release / Project / Source / EditRoutines.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-10-30  |  2.7 KB  |  78 lines  |  [TEXT/CWIE]

  1. /*
  2.  * The contents of this file are subject to the Mozilla Public
  3.  * License Version 1.1 (the "License"); you may not use this file
  4.  * except in compliance with the License. You may obtain a copy of
  5.  * the License at http://www.mozilla.org/MPL/
  6.  * 
  7.  * Software distributed under the License is distributed on an "AS
  8.  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  9.  * implied. See the License for the specific language governing
  10.  * rights and limitations under the License.
  11.  * 
  12.  * The Original Code is Copyright 1993 Jim Bumgardner.
  13.  * 
  14.  * The Initial Developer of the Original Code is Jim Bumgardner
  15.  * Portions created by Lane Roathe are
  16.  * Copyright (C) Copyright © 1996-2002.
  17.  * All Rights Reserved.
  18.  *
  19.  * Modified: $Date: 2004/09/08 19:48:59 $
  20.  * Revision: $Id: EditRoutines.h,v 1.5 2004/09/08 19:48:59 raving Exp $
  21.  *
  22.  * Contributor(s):
  23.  *        Lane Roathe
  24.  *        Nick Shanks
  25.  */
  26.  
  27. #include "EditWindow.h"
  28.  
  29. #ifndef _HexEdit_EditRoutines_
  30. #define _HexEdit_EditRoutines_
  31.  
  32. /*** UNDO RECORD ***/
  33. //LR: 1.66 - get rid of back-ass delcaration method
  34. typedef struct
  35. {
  36.     short            type;                // Type of operation
  37.     short            reserved;
  38.     long            startSel;            // Start of Selection
  39.     long            endSel;                // End of Selection
  40.     long            fileSize;            // File Size for Undo Op
  41.     EditChunk        **undoScrap;
  42.     EditWindowPtr    theWin;
  43. }UndoRecord, *UndoPtr;
  44.  
  45. // --- Global vars ---
  46.  
  47. extern UndoRecord gUndo, gRedo;
  48.  
  49. // --- Prototypes ---
  50.  
  51. void LoadFile( EditWindowPtr dWin );
  52. void UnloadFile( EditWindowPtr dWin );
  53. EditChunk** NewChunk( long size, long addr, long filePos, short type );
  54. void DisposeChunk( EditWindowPtr dWin, EditChunk **cc );
  55. EditChunk** AppendChunk( EditChunk **list, EditChunk **chunk );
  56. void SetCurrentChunk( EditWindowPtr dWin, long addr );
  57. EditChunk** GetChunkByAddr( EditWindowPtr dWin, long addr );
  58. Byte GetByte( EditWindowPtr dWin, long addr );
  59. void LoadChunk( EditWindowPtr dWin, EditChunk **cc );
  60. void UnloadLeastUsedChunk( EditWindowPtr dWin );
  61. void UnloadChunk( EditWindowPtr dWin, EditChunk    **cc, Boolean writeFlag );
  62. void RewriteAddressChain( EditChunk **fc );
  63. void RemoveSelection( EditWindowPtr dWin );
  64. void DeleteSelection( EditWindowPtr dWin );
  65. void InsertCharacter( EditWindowPtr dWin, short charCode );
  66. void ReleaseEditScrap( EditWindowPtr dWin, EditChunk ***scrap );
  67. void CopySelection( EditWindowPtr dWin );
  68. void CopyOperation( EditWindowPtr dWin, EditChunk ***scrapChunk );
  69. void CutSelection( EditWindowPtr dWin );
  70. void MyGetScrap( EditWindowPtr dWin );
  71. void PasteSelection( EditWindowPtr dWin );
  72. Boolean HexConvertScrap( EditWindowPtr dWin, EditChunk **scrapChunk );
  73. void PasteOperation( EditWindowPtr dWin, EditChunk **scrapChunk );
  74. void ClearSelection( EditWindowPtr dWin );
  75. void RememberOperation( EditWindowPtr dWin, short opType, UndoPtr ur );
  76. void UndoOperation( void );
  77.  
  78. #endif